package com.glls.sbdemo10.controller;

import com.glls.sbdemo10.common.R;
import com.glls.sbdemo10.pojo.User;
import com.glls.sbdemo10.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @date 2023/5/11
 * @desc
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;
    @RequestMapping("/login")
    public R login(String name,String password){
        User currentUser = userService.login(name,password);


        return R.ok().data("user",currentUser);
    }


}
